import { configureStore } from '@reduxjs/toolkit'
import common from './common'
import storage from 'redux-persist/lib/storage';
import { persistReducer, persistStore } from 'redux-persist';


const persistConfig = {
    key: 'root',
    storage,
  }


const persistedCommon = persistReducer(persistConfig, common)
  
const store = configureStore({
    reducer: {
      common: persistedCommon
    },
    middleware: getDefaultMiddleware =>
    getDefaultMiddleware({
      serializableCheck: false,
    }),
  })
  
  export default store;
  export const persistor = persistStore(store)
  
  